﻿using System;
using WholesaleOnline.Controller.Request;
using WholesaleOnline.Controller.Storage;

namespace WholesaleOnline.Controller.Handlers
{
    public class CheckLoginHandler : RequestHandler
    {
        public CheckLoginHandler(IHttpStorage storage) : base(storage) { }

        public override void Handle(WebRequest webRequest)
        {
            if (webRequest.LoginId == Guid.Empty)
                Storage.Add(HttpStorageKeys.Redirect, "~/Pages/LoginPage.aspx");
            else
                base.NextHandler.Handle(webRequest);
        }
    }
}
